package com.atguigu.gmall.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 *
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(201, "失败"),
    SERVICE_ERROR(2012, "服务异常"),

    PAY_RUN(205, "支付中"),

    LOGIN_AUTH(208, "未登陆"),
    PERMISSION(209, "没有权限"),
    SECKILL_OK(200, "秒杀请求提交成功"),
    SECKILL_NO_START(210, "秒杀还没开始"),
    SECKILL_RUN(211, "正在排队中"),
    SECKILL_NO_PAY_ORDER(212, "您有未支付的订单"),
    SECKILL_FINISH(213, "已售罄"),
    SECKILL_END(214, "秒杀已结束"),
    SECKILL_SUCCESS(215, "抢单成功"),
    SECKILL_FAIL(216, "抢单失败"),
    SECKILL_ILLEGAL(217, "请求不合法"),
    SECKILL_ORDER_SUCCESS(218, "下单成功"),
    COUPON_GET(220, "优惠券已经领取"),
    COUPON_LIMIT_GET(221, "优惠券已发放完毕"),
    BITMAP_NOT_EXITS(20000,"位图偏移量不存在"),
    PARAMS_ERROR(30000, "参数非法"),
    BLOCK_IPADDRESS(40000, "黑名单用户"),

    CART_ITEM_NUM_ERROR(50000, "购物车商品条目超过上限"),
    CART_ITEM_MERGE_ERROR(50001, "未登录状态的购物车数量过多，请清理一下"),
    CART_NUM_ERROR(50002, "购物车单个商品数量不能超过100个"),
    //------------------------------------600000    订单相关
    ORDER_REPEAT_COMMIT_ERROR(60001,"请勿重复提交订单，请刷新页面后重试"),
    ORDER_PRICE_CHANGE_ERROR(60002, "订单中{}价格有变动"),
    ORDER_NO_WARE_ERROR(60003, "订单中{}库存不足"),

    ORDER_CHECK_SIGN_ERROR(60004,"验签失败，疑是黑客攻击"),
    ORDER_SPLIT_ERROR(60005,"当前订单无需拆单"),

    //    --------------------------------------秒杀相关的code
    SECKILL_STOCK_NOT_ERROR(70001, "秒杀库存不足"),
    ;
    private Integer code;

    private String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
